let username = document.getElementById("regin1");
let password = document.getElementById("regin2");
let btn = document.getElementById("regin3");
btn.onclick = function () {

    let us = username.value;
    let ps = password.value;
    let regAPI = "http://jx.xuzhixiang.top/ap/api/reg.php";

    axios.get(regAPI, {
        params: {
            username: us,
            password: ps
        }

    }).then(function (res) {
        //请求成功
        console.log(res.data);
        alert(res.data.msg)
        //如果请求成功则跳转
        if (res.data.code == 1) {
            location.href = "login.html"
        }
    }).catch(function (err) {
        //请求失败
        // console.log(err.data.msg);
        alert(err.data.msg)
    })
};
